/** 
*
* @author  jiwf 
* @date 创建时间：2016年9月1日 下午10:42:50 
* @version 1.0 
* @since  
*  
*/
package com.xbstar.bean;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.json.JSONObject;


import com.xbstar.tools.Timer;
import com.xbstar.wei.service2.Message.WEIUSERINFO;

@Entity
public class WeiUserInfo {

	@Id
	private String openId;
	private String nickName;
	private String sex;
	private String province;
	private String city;
	private String country;
	private String headImgUrl;
	private String privilege;
	private String unionId;
	private String createdTime;
	private String updatedTime;
	public String getCreatedTime() {
		return createdTime;
	}

	public void setCreatedTime(String createdTime) {
		this.createdTime = createdTime;
	}

	public String getUpdatedTime() {
		return updatedTime;
	}

	public void setUpdatedTime(String updatedTime) {
		if (this.updatedTime == null) {
			this.updatedTime = updatedTime;
		}
	}
	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getHeadImgUrl() {
		return headImgUrl;
	}

	public void setHeadImgUrl(String headImgUrl) {
		this.headImgUrl = headImgUrl;
	}

	public String getPrivilege() {
		return privilege;
	}

	public void setPrivilege(String privilege) {
		this.privilege = privilege;
	}

	public String getUnionId() {
		return unionId;
	}

	public void setUnionId(String unionId) {
		this.unionId = unionId;
	}

	public WeiUserInfo() {
		this.createdTime = Timer.getCurrentString();
		this.updatedTime = this.createdTime;
	}

	public WeiUserInfo(JSONObject userjson) {
		this();
		this.openId= userjson.optString(WEIUSERINFO.OpenId);
		this.city=userjson.optString(WEIUSERINFO.City);
		this.country=userjson.optString(WEIUSERINFO.Country);
		this.nickName=userjson.optString(WEIUSERINFO.NickName);
		this.unionId=userjson.optString(WEIUSERINFO.Unionid);
		this.headImgUrl=userjson.optString(WEIUSERINFO.HeadImgUrl);
		this.province=userjson.optString(WEIUSERINFO.Province);
		this.privilege=userjson.optString(WEIUSERINFO.Privilege);
		this.sex=userjson.optString(WEIUSERINFO.Sex);
	}

}
